import request from '@/utils/request'

const api = {
    notion: '/notion'
}

export function saveNotion(parameter)
{
    return request({
        url: api.notion,
        method: 'post',
        data: parameter,
        headers: {
            'Content-Type': 'application/json;charset=UTF-8'
        }
    })
}

/**
 * 删除阅文意见
 * @param { Object } parameter 
 * @param { String } parameter.P_unids 阅文意见unid
 * @returns 
 */
export function delNotion(parameter)
{
    return request({
        url: api.notion,
        method: 'Delete',
        params: parameter
    })
}


export function getNodeList(params)
{
    return request({
        url:"/flow/func/getNodeList",
        method:"get",
        params
    })
}

export function getPersonListByNodeId(params)
{
    return request({
        url:"/flow/func/getPersonListByNodeId",
        method:"get",
        params
    })
}

export function getNotionList(parameter)
{
    return request({
        url: api.notion + '/list',
        method: 'get',
        params: parameter
    })
}

export function getNotion(unid)
{
    return request({
        url: api.notion + '/' + unid,
        method: 'get'
    })
}

// 获取意见可选类型
export function getNotionType(params)
{
    return request({
        url: '/flow/func/getNotionType',
        method: 'get',
        params
    })
}

// 修改阅文意见
export function changeYwjy(data)
{
    return request({
        url: "/ywyjxg/add",
        method: "post",
        data
    })
}

//获取阅文意见设置
export function getSetting()
{
    return request({
        url: "/ywyjxgSetting/getSetting",
        method: "get"
    })
}